<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserCreateCreateOrderItemTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //子订单表
        Schema::create('order_item', function (Blueprint $table) {
            $table->increments('id')->comment('自增id');
            $table->integer('good_id')->comment('商品id');
            $table->integer('order_id')->comment('订单id');
            $table->string('item_num')->nullable()->comment('子订单编号');
            $table->decimal('m_price')->default(0)->comment('商品原单价');
            $table->string('s_price')->default(0)->comment('商品打折后单价');
            $table->integer('num')->default(0)->comment('购买数量');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
